package cn.itsource.autoconfigure;

import cn.itsource.config.CosProperties;
import cn.itsource.core.CosTemplate;
import cn.itsource.core.MyCosClient;
import cn.itsource.core.SMSTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties({CosProperties.class})
public class CosAutoConfiguration {
   @Bean
   public CosTemplate getCosTemplate(CosProperties cosProperties, MyCosClient myCosClient){
       return new CosTemplate(cosProperties,myCosClient.getCOSClient());
   }

   @Bean
   public MyCosClient getMyCosClient(CosProperties cosProperties){
       return new MyCosClient(cosProperties);
   }

   @Bean
   public SMSTemplate getSMSTemplate(){
       return new SMSTemplate();
   }

}
